var realm = require('../models')
const app_prefix = '_app_'

const initApps = async () => {
  const data = require('./initData')
  let apps = realm.objects('App')
  for (let i = 0; i < data.apps.length; i++) {
    let app = data.apps[i]
    app.id = app.appId
    if (apps.filtered('id = $0', app.id).length == 0) {
      realm.write(() => {
        realm.create('App', app)
      })
    }
  }
}
initApps()
